package com.tangyee.home_knowledge.dao;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

/**
 * 历史纪录数据库
 */
public class RecordSQLiteOpenHelper extends SQLiteOpenHelper {

    private static String name = "KnowledgeHistorySearch.db";
    private static Integer version = 1;
    public RecordSQLiteOpenHelper(Context context) {
        super(context, name, null, version);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        // 打开数据库 & 建立了一个叫 records 的表，里面只有一列 name 来存储历史记录：
        db.execSQL("create table records(id integer primary key autoincrement ," +
                "name varchar(200))");
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
    }
}
